package com.example.javapracticaltraining.entity.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.example.javapracticaltraining.entity.BaseData;
import java.util.Date;
import lombok.Data;

/**
 * 老人个性化膳食需求表
 * @TableName elderly_diet_need
 */
@TableName(value ="elderly_diet_need")
@Data
public class ElderlyDietNeed implements BaseData {
    /**
     * 
     */
    @TableId(value = "need_id", type = IdType.AUTO)
    private Integer needId;

    /**
     * 老人ID
     */
    @TableField(value = "elderly_id")
    private Integer elderlyId;

    /**
     * 膳食类型ID
     */
    @TableField(value = "diet_type_id")
    private Integer dietTypeId;

    /**
     * 特殊需求
     */
    @TableField(value = "special_requirements")
    private String specialRequirements;

    /**
     * 过敏信息
     */
    @TableField(value = "allergies")
    private String allergies;

    /**
     * 饮食习惯
     */
    @TableField(value = "eating_habits")
    private String eatingHabits;

    /**
     * 营养目标
     */
    @TableField(value = "nutrition_goals")
    private String nutritionGoals;

    /**
     * 医生建议
     */
    @TableField(value = "doctor_advice")
    private String doctorAdvice;

    /**
     * 创建人ID
     */
    @TableField(value = "creator_id")
    private Integer creatorId;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private Date updateTime;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ElderlyDietNeed other = (ElderlyDietNeed) that;
        return (this.getNeedId() == null ? other.getNeedId() == null : this.getNeedId().equals(other.getNeedId()))
            && (this.getElderlyId() == null ? other.getElderlyId() == null : this.getElderlyId().equals(other.getElderlyId()))
            && (this.getDietTypeId() == null ? other.getDietTypeId() == null : this.getDietTypeId().equals(other.getDietTypeId()))
            && (this.getSpecialRequirements() == null ? other.getSpecialRequirements() == null : this.getSpecialRequirements().equals(other.getSpecialRequirements()))
            && (this.getAllergies() == null ? other.getAllergies() == null : this.getAllergies().equals(other.getAllergies()))
            && (this.getEatingHabits() == null ? other.getEatingHabits() == null : this.getEatingHabits().equals(other.getEatingHabits()))
            && (this.getNutritionGoals() == null ? other.getNutritionGoals() == null : this.getNutritionGoals().equals(other.getNutritionGoals()))
            && (this.getDoctorAdvice() == null ? other.getDoctorAdvice() == null : this.getDoctorAdvice().equals(other.getDoctorAdvice()))
            && (this.getCreatorId() == null ? other.getCreatorId() == null : this.getCreatorId().equals(other.getCreatorId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getNeedId() == null) ? 0 : getNeedId().hashCode());
        result = prime * result + ((getElderlyId() == null) ? 0 : getElderlyId().hashCode());
        result = prime * result + ((getDietTypeId() == null) ? 0 : getDietTypeId().hashCode());
        result = prime * result + ((getSpecialRequirements() == null) ? 0 : getSpecialRequirements().hashCode());
        result = prime * result + ((getAllergies() == null) ? 0 : getAllergies().hashCode());
        result = prime * result + ((getEatingHabits() == null) ? 0 : getEatingHabits().hashCode());
        result = prime * result + ((getNutritionGoals() == null) ? 0 : getNutritionGoals().hashCode());
        result = prime * result + ((getDoctorAdvice() == null) ? 0 : getDoctorAdvice().hashCode());
        result = prime * result + ((getCreatorId() == null) ? 0 : getCreatorId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", needId=").append(needId);
        sb.append(", elderlyId=").append(elderlyId);
        sb.append(", dietTypeId=").append(dietTypeId);
        sb.append(", specialRequirements=").append(specialRequirements);
        sb.append(", allergies=").append(allergies);
        sb.append(", eatingHabits=").append(eatingHabits);
        sb.append(", nutritionGoals=").append(nutritionGoals);
        sb.append(", doctorAdvice=").append(doctorAdvice);
        sb.append(", creatorId=").append(creatorId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append("]");
        return sb.toString();
    }
}